<!-- 出库订单详情 -->
<template>
  <div class="page-container" v-loading="loading" v-loadingCommonStyle>
    <ex_header_spiler :title="$tt('label_base_info')" />
    <ex_super_desc v-bind="baseOption" :data="form" :attrs="$defaultDetailDescAttrs"/>
    <ex_header_spiler :title="$tt('label_forecast_good_detail')" />
    <ex_super_table :model="tableModel" :data="form.orderBoxDetailList" size="default" />
    <ex_header_spiler :title="$tt('label_car_photos')" />
    <div class="car_photos">
      <ex_super_upload :disabled="true" :value="imageList"></ex_super_upload>
    </div>

  </div>
</template>
<script>
import router_params from '@/mixin/router_params';

export default {
  mixins: [router_params],
  components: {},
  data() {
    return {
      loading: false,

      form: {},
      baseOption: {

        model: [
          { key: 'transitNo', label: 'label_waybill_code', },
          { key: 'gmtCreate', label: 'label_schedule_appointment_time', formatter: (r, c, v, i) => this.$dateFormat(v) },
          { key: 'customerName', label: 'label_customer_name' },
          { key: 'scheduleTypeEnum', label: 'label_schedule_method', formatter: (r, c, v, i) => this.$enumShow(v, "ScheduleTypeEnum") },
          { key: 'gmtModify', label: 'label_update_time', formatter: (r, c, v, i) => this.$dateFormat(v) },
          { key: 'expectPackagingQty', label: 'label_declared_box_number' },
          { key: 'expectBoxQty', label: 'label_declared_package_number' },
          { key: 'vehicleNo', label: 'label_car_number' },
          { key: 'driverName', label: 'label_driver_name' },
          { key: 'driverPhone', label: 'label_driver_phone' },
          { key: 'volumn', label: 'label_declare_goods_sum_volume' },
          { key: 'weight', label: 'label_declare_goods_sum_weight' },
          { key: 'reporter', label: 'label_declare_user' },
          { key: 'scheduleStatusEnum', label: 'label_schedule_status', formatter: (r, c, v, i) => this.$enumShow(v, "ScheduleStatusEnum") },
          { key: 'checkUserName', label: 'label_audit_user' },
          { key: 'checkTime', label: 'label_audit_time', formatter: (r, c, v, i) => this.$dateFormat(v) },
          { key: 'refuseReason', label: 'label_reject_reason' },
        ],
      },
      tableModel: [
        { key: "boxNumber", label: "label_index_number", 'show-overflow-tooltip': true },
        { key: "inboundOrderCode", label: "label_inbound_code", 'show-overflow-tooltip': true },
        { key: "packageNo", label: "label_big_package_code", 'show-overflow-tooltip': true },
        { key: "boxNo", label: "label_box_code", 'show-overflow-tooltip': true },
        { key: "skuOnlyCode", label: "label_sku_only_code", 'show-overflow-tooltip': true },
        { key: "skuName", label: "label_sku_name", 'show-overflow-tooltip': true },
        { key: "quantity", label: "label_sku_count", 'show-overflow-tooltip': true },
        { key: "receivingQty", label: "label_actual_receiving_number", 'show-overflow-tooltip': true },
        { key: "receivingStatus", label: "label_receiving_status", 'show-overflow-tooltip': true,formatter: (r, c, v, i) => this.$enumShow(v, "ReceivingStatusEnum")  },
      ],
      imageList:[]
    };
  },

  methods: {
    init_data_default(into_params) {
      this.imageList = []
      if (into_params.id) {
        this.loading = true
        this.$ajax({
          url: "/wms-api/inbound/WmsInboundScheduleRpc/detail.json",
          method: 'post',
          data: { scheduleId: into_params.id },
          success: (res) => {
            this.loading = false
            this.form = res.data
            res.data.imageList.forEach(item=>{
              if(item.fileUrl){
                this.imageList.push({filePath:item.fileUrl})
              }
            })
          }
        })
      }
      this.$emit("tagModifyLabel", {
          _key: 'label_name_code', name: this.$tt("title_appointment_report_detail"),
          code: into_params.id || ''
        })
    },
  }
};

</script>
<style lang="less" scoped>
.car_photos{
  margin-top: 15px;
  display: flex;
  gap: 0 10px;
  >.el-image{
    width: 180px;
    height: 180px;
    border-radius: 5px;
    background-color: #D9DFE7;
    border: 8px solid #D9DFE7;
  }
}
</style>
